package com.example.myapplication10;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

public class BookDetailActivity extends AppCompatActivity {
    private TextView tvTitle, tvAuthor, tvDesc;
    private ImageView imgCover;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_book_detail);

        tvTitle = findViewById(R.id.tvTitle);
        tvAuthor = findViewById(R.id.tvAuthor);
        tvDesc = findViewById(R.id.tvDesc);
        imgCover = findViewById(R.id.imgCover);

        // 获取 Intent 传递的数据
        String title = getIntent().getStringExtra("title");
        String author = getIntent().getStringExtra("author");
        int coverResId = getIntent().getIntExtra("coverResId", 0);
        String desc = getIntent().getStringExtra("desc");

        // 设置 UI
        tvTitle.setText(title);
        tvAuthor.setText(author);
        imgCover.setImageResource(coverResId);
        tvDesc.setText(desc);
    }
}